﻿using System;
using System.Collections.Generic;
using System.Text;

using YouHP.Model;
using YouHP.DALFactory;

namespace YouHP.BLL
{
    public class DistrictBLL
    {
        #region 单件模式
        static DistrictBLL _Instance;

        public static DistrictBLL Instance
        {
            get
            {
                if (_Instance == null)
                {
                    _Instance = new DistrictBLL();
                }
                return _Instance;
            }
        }
        #endregion

        public bool AddDistrict(DistrictInfo info)
        {
            return DataAccess.DistrictDAL.AddDistrict(info);
        }

        public bool DelDistrict(int[] itemIds)
        {
            return DataAccess.DistrictDAL.DelDistrict(itemIds);
        }

        public bool UpdateDistrict(DistrictInfo info)
        {
            return DataAccess.DistrictDAL.UpdateDistrict(info);
        }

        public DistrictInfo GetDistrict(int id)
        {
            return DataAccess.DistrictDAL.GetDistrict(id);
        }

        public List<DistrictInfo> GetDistrictListByParent(int parentId)
        {
            return DataAccess.DistrictDAL.GetDistrictListByParent(parentId);
        }

        public List<DistrictInfo> GetDistrictList()
        {
            return DataAccess.DistrictDAL.GetDistrictList();
        }
    }
}
